Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outfit cleanup #16857

Merged
merged 24 commits into from
Jan 23, 2025
Merged

Outfit cleanup #16857

merged 24 commits into from
Jan 23, 2025

Conversation

ivanmixo
Copy link
Contributor

@ivanmixo ivanmixo commented Dec 29, 2024

About The Pull Request

Took the absolute behemoth that #16627 is and brought it down to just the outfit changes. I've also moved all the outfit datums into their own folders in their own files instead of them being put in the already crammed job files/folders.

Example

The goal is to turn this

/datum/outfit/job/deathsquad/standard
	name = "Deathsquad Standard"
	jobtype = /datum/job/deathsquad/standard
	id = /obj/item/card/id/silver
	belt = /obj/item/weapon/gun/energy/lasgun/pulse
	ears = /obj/item/radio/headset/distress/commando
	w_uniform = /obj/item/clothing/under/marine/veteran/pmc/commando
	shoes = /obj/item/clothing/shoes/marine/deathsquad
	wear_suit = /obj/item/clothing/suit/storage/marine/veteran/pmc/commando
	gloves = /obj/item/clothing/gloves/marine/veteran/pmc/commando
	head = /obj/item/clothing/head/helmet/marine/veteran/pmc/commando
	mask = /obj/item/clothing/mask/gas/pmc
	glasses = /obj/item/clothing/glasses/night/m42_night_goggles
	suit_store = /obj/item/weapon/gun/flamer/big_flamer/marinestandard/deathsquad
	r_store = /obj/item/storage/pouch/medkit
	l_store = /obj/item/storage/pouch/grenade
	back = /obj/item/storage/backpack/commando
	implants = list(/obj/item/implant/suicide_dust)

/datum/outfit/job/deathsquad/standard/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
	. = ..()
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/smokebomb/acid, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/smokebomb/neuro, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/smokebomb/drain, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/smokebomb/cloak, SLOT_IN_SUIT)

	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_HEAD)
	H.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba, SLOT_IN_HEAD)

	H.equip_to_slot_or_del(new /obj/item/storage/pill_bottle/hypervene, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/storage/pill_bottle/packet/ryetalyn, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/advanced/oxycodone, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/autoinjector/elite, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/autoinjector/elite, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/autoinjector/elite, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/autoinjector/elite, SLOT_IN_R_POUCH)

	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/phosphorus, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/phosphorus, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_L_POUCH)

	H.equip_to_slot_or_del(new /obj/item/tool/crowbar/red, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/binoculars, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/food/snacks/wrapped/chunk, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/weapon/energy/sword/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/weapon/shield/energy, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/cell/lasgun/pulse, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)

Into this

/datum/outfit/job/deathsquad/standard
	name = "Deathsquad Standard"
	jobtype = /datum/job/deathsquad/standard
	id = /obj/item/card/id/silver
	belt = /obj/item/weapon/gun/energy/lasgun/pulse
	ears = /obj/item/radio/headset/distress/commando
	w_uniform = /obj/item/clothing/under/marine/veteran/pmc/commando
	shoes = /obj/item/clothing/shoes/marine/deathsquad
	wear_suit = /obj/item/clothing/suit/storage/marine/veteran/pmc/commando
	gloves = /obj/item/clothing/gloves/marine/veteran/pmc/commando
	head = /obj/item/clothing/head/helmet/marine/veteran/pmc/commando
	mask = /obj/item/clothing/mask/gas/pmc
	glasses = /obj/item/clothing/glasses/night/m42_night_goggles
	suit_store = /obj/item/weapon/gun/flamer/big_flamer/marinestandard/deathsquad
	r_pocket = /obj/item/storage/pouch/medkit
	l_pocket = /obj/item/storage/pouch/grenade
	back = /obj/item/storage/backpack/commando
	implants = list(/obj/item/implant/suicide_dust)

	backpack_contents = list(
		/obj/item/explosive/plastique = 6,
		/obj/item/tool/crowbar/red = 1,
		/obj/item/binoculars = 1,
		/obj/item/reagent_containers/food/snacks/wrapped/chunk = 1,
		/obj/item/weapon/energy/sword/deathsquad = 1,
		/obj/item/weapon/shield/energy = 1,
		/obj/item/cell/lasgun/pulse = 1,
		/obj/item/ammo_magazine/flamer_tank/large/X/deathsquad = 7,
	)

	suit_contents = list(
		/obj/item/explosive/grenade/pmc = 2,
		/obj/item/explosive/grenade/smokebomb/acid = 1,
		/obj/item/explosive/grenade/smokebomb/neuro = 1,
		/obj/item/explosive/grenade/smokebomb/drain = 1,
		/obj/item/explosive/grenade/smokebomb/cloak = 1,
	)

	head_contents = list(
		/obj/item/explosive/plastique = 1,
		/obj/item/clothing/mask/cigarette/cigar/cohiba = 1,
	)

	l_pocket_contents = list(
		/obj/item/explosive/grenade/pmc = 4,
		/obj/item/explosive/grenade/phosphorus = 2,
	)

	r_pocket_contents = list(
		/obj/item/storage/pill_bottle/hypervene = 1,
		/obj/item/storage/pill_bottle/packet/ryetalyn = 1,
		/obj/item/reagent_containers/hypospray/advanced/oxycodone = 1,
		/obj/item/reagent_containers/hypospray/autoinjector/elite = 4,
	)

Why It's Good For The Game

This makes the outfit code so much less cancer to both write and look at, and it also adds safeguards against trying to cram too much stuff into a single container. Very cool.

Changelog

🆑
refactor: Refactored the way outfits populate the contents of containers
/:cl:

@tgstation-server tgstation-server added the Refactor Improves underlying code to make systems more modular and functional. label Dec 29, 2024
@github-actions github-actions bot added the Merge Conflict Pull request is in a conflicted state with base branch. label Jan 3, 2025
Copy link
Contributor

This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 3 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself

@github-actions github-actions bot added the Stale Pull request is awaiting delayed author response and may be closed. label Jan 12, 2025
@github-actions github-actions bot closed this Jan 16, 2025
@QualityVan QualityVan reopened this Jan 17, 2025
@tgstation-server tgstation-server removed the Merge Conflict Pull request is in a conflicted state with base branch. label Jan 17, 2025
@QualityVan QualityVan removed the Stale Pull request is awaiting delayed author response and may be closed. label Jan 17, 2025
@QualityVan QualityVan added the Test Merge Candidate This PR has been reviewed and is ready for testing, unless something changes. label Jan 18, 2025
@Lumipharon Lumipharon merged commit 7329e0d into tgstation:master Jan 23, 2025
41 checks passed
github-actions bot added a commit that referenced this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Improves underlying code to make systems more modular and functional. Test Merge Candidate This PR has been reviewed and is ready for testing, unless something changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants